<?php
include(dirname(dirname(dirname(__FILE__)))."/zhconfig/Config.php");
include 'phpqrcode.php'; 
error_reporting(E_ALL);
ini_set('display_errors', '1');
$userid = $_GET['userid'];//二维码数据
$value = $_GET['canshu'];//二维码数据
$errorCorrectionLevel = 'L';//纠错级别：L、M、Q、H
$matrixPointSize = 10;//二维码点的大小：1到10

$fpath = getfilepath();
$rfilename = date("dMYHis").rand(1,4000).".png";

$QR = ZH_PATH.$fpath.'/'.$rfilename;//已经生成的原始二维码图
QRcode::png ( $value, $QR, $errorCorrectionLevel, $matrixPointSize, 2 );//不带Logo二维码的文件名

//QRcode::png ( $value, false, $errorCorrectionLevel, $matrixPointSize, 2 );//不带Logo二维码的文件名
$config = array(
    'image'=>array(
        array(
            'url'=> $QR,			//二维码资源
            'stream'=>0,
            'left'=>350,
            'top'=>1750,
            'right'=>0,
            'bottom'=>0,
            'width'=>350,
            'height'=>350,
            'opacity'=>100
        )
    ),
    'background'=>ZH_PATH.'/h5/banzhushenghuo/haibao.jpg'//背景图
);

$filename1='/haibao-'.$userid.'-1.jpg';
$filename = ZH_PATH.$fpath.$filename1;
$filename2 = $fpath.$filename1;
createPoster($config,$filename);
